package elevador;

import java.awt.Color;
import java.awt.Font;
import java.awt.Label;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.LayoutStyle.ComponentPlacement;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Floor.java
 *
 * Created on 11/06/2011, 11:09:52
 */

/**
 * 
 * @author Victor
 * @author Breno
 */
public class Floor extends javax.swing.JPanel {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private javax.swing.JButton upButton;
	private javax.swing.JButton downButton;
	private javax.swing.JPanel jPanel11;
	private javax.swing.JPanel jPanel12;
	private javax.swing.JPanel jPanel13;
	private javax.swing.JPanel jPanel14;
	private javax.swing.JPanel jPanel15;
	private javax.swing.JPanel jPanel7;
	private javax.swing.JPanel jPanel9;
	private javax.swing.JSeparator jSeparator1;
	private javax.swing.JSeparator jSeparator10;
	private javax.swing.JSeparator jSeparator9;
	private java.awt.Label label1;
	private java.awt.Label lamp5Elev1;
	private java.awt.Label lampElev1_11;
	private java.awt.Label lampElev1_12;
	private java.awt.Label lampElev1_13;
	private java.awt.Label lampElev1_14;
	private java.awt.Label lamp1Elev2;
	private java.awt.Label lamp2Elev2;
	private java.awt.Label lamp3Elev2;
	private java.awt.Label lamp4Elev2;
	private java.awt.Label lamp5Elev2;
	private java.awt.Label lampElev1_2;
	private java.awt.Label lampElev1_3;
	private java.awt.Label lampElev1_4;
	private java.awt.Label lampElev1_5;
	private java.awt.Label lamp1Elev1;
	private java.awt.Label lamp2Elev1;
	private java.awt.Label lamp3Elev1;
	private java.awt.Label lamp4Elev1;
	private JLabel statusLampElev1;
	private java.awt.Label lampTElev1;
	private JLabel statusLampElev2;
	private java.awt.Label lampTElev2;
	private JPanel panelSelDestE2;
	private JPanel panelSelDestE1;
	private JButton btnTE2;
	private JButton btn1E2;
	private JButton btn2E2;
	private JButton btn3E2;
	private JButton btn4E2;
	private JButton btn5E2;
	private JButton btnTE1;
	private JButton btn1E1;
	private JButton btn2E1;
	private JButton btn3E1;
	private JButton btn4E1;
	private JButton btn5E1;
	
    private String floorName;
	private int floorNumber;

	private List<Label> lampListElev1;
	private List<Label> lampListElev2;
	
	private ArrayList<Integer> destinysE1;
	private ArrayList<Integer> destinysE2;

	private ArrayList<JButton> btnsDestE1;
	private ArrayList<JButton> btnsDestE2;
	
	private Elevator elevator1;
	private Elevator elevator2;
	
    /** Creates new form FloorJPanel */
    public Floor(String floorName, JTabbedPane jTabbedPane, int floorNumber) {
    	this.floorNumber = floorNumber;
        this.floorName = floorName;
        initComponents();
        
        destinysE1 = new ArrayList<Integer>(6);
        destinysE2 = new ArrayList<Integer>(6);

        lampListElev1 = new ArrayList<Label>(6);
        lampListElev1.add(lampTElev1);
        lampListElev1.add(lamp1Elev1);
        lampListElev1.add(lamp2Elev1);
        lampListElev1.add(lamp3Elev1);
        lampListElev1.add(lamp4Elev1);
        lampListElev1.add(lamp5Elev1);

        lampListElev2 = new ArrayList<Label>(6);
        lampListElev2.add(lampTElev2);
        lampListElev2.add(lamp1Elev2);
        lampListElev2.add(lamp2Elev2);
        lampListElev2.add(lamp3Elev2);
        lampListElev2.add(lamp4Elev2);
        lampListElev2.add(lamp5Elev2);
        
        btnsDestE1 = new ArrayList<JButton>(6);
        btnsDestE1.add(btnTE1);
        btnsDestE1.add(btn1E1);
        btnsDestE1.add(btn2E1);
        btnsDestE1.add(btn3E1);
        btnsDestE1.add(btn4E1);
        btnsDestE1.add(btn5E1);
        
        btnsDestE2 = new ArrayList<JButton>(6);
        btnsDestE2.add(btnTE2);
        btnsDestE2.add(btn1E2);
        btnsDestE2.add(btn2E2);
        btnsDestE2.add(btn3E2);
        btnsDestE2.add(btn4E2);
        btnsDestE2.add(btn5E2);

        jTabbedPane.addTab(floorName, this);
    }
    
    /** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
	private void initComponents() {
	
	    label1 = new java.awt.Label();
	    jSeparator1 = new javax.swing.JSeparator();
	    jPanel7 = new javax.swing.JPanel();
	    upButton = new javax.swing.JButton();
	    downButton = new javax.swing.JButton();
	    jPanel9 = new javax.swing.JPanel();
	    statusLampElev1 = new JLabel();
	    statusLampElev1.setIcon(new ImageIcon(Floor.class.getResource("/icons/Parado.png")));
	    lampElev1_2 = new java.awt.Label();
	    lampElev1_3 = new java.awt.Label();
	    lampElev1_4 = new java.awt.Label();
	    lampElev1_5 = new java.awt.Label();
	    jPanel12 = new javax.swing.JPanel();
	    lampTElev1 = new java.awt.Label();
	    lamp1Elev1 = new java.awt.Label();
	    lamp2Elev1 = new java.awt.Label();
	    lamp3Elev1 = new java.awt.Label();
	    lamp4Elev1 = new java.awt.Label();
	    lamp5Elev1 = new java.awt.Label();
	    jPanel11 = new javax.swing.JPanel();
	    statusLampElev2 = new JLabel();
	    statusLampElev2.setIcon(new ImageIcon(Floor.class.getResource("/icons/Parado.png")));
	    lampElev1_11 = new java.awt.Label();
	    lampElev1_12 = new java.awt.Label();
	    lampElev1_13 = new java.awt.Label();
	    lampElev1_14 = new java.awt.Label();
	    jPanel13 = new javax.swing.JPanel();
	    lampTElev2 = new java.awt.Label();
	    lamp1Elev2 = new java.awt.Label();
	    lamp2Elev2 = new java.awt.Label();
	    lamp3Elev2 = new java.awt.Label();
	    lamp4Elev2 = new java.awt.Label();
	    lamp5Elev2 = new java.awt.Label();
	    jPanel14 = new javax.swing.JPanel();
	    jSeparator9 = new javax.swing.JSeparator();
	    jPanel15 = new javax.swing.JPanel();
	    jSeparator10 = new javax.swing.JSeparator();
	
	    label1.setAlignment(java.awt.Label.CENTER);
	    label1.setFont(new java.awt.Font("Onyx", 1, 36)); // NOI18N
	    label1.setText(floorName);
	
	    jPanel7.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
	    jPanel7.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
	
	    upButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/buttonUp.png"))); // NOI18N
	    upButton.setBorder(null);
	    upButton.setContentAreaFilled(false);
	    upButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
	    upButton.addActionListener(new java.awt.event.ActionListener() {
	        public void actionPerformed(java.awt.event.ActionEvent evt) {
	            jButton1ActionPerformed(evt);
	        }
	    });
	
	    downButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/buttonDown.png"))); // NOI18N
	    downButton.setBorder(null);
	    downButton.setContentAreaFilled(false);
	    downButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
	    downButton.addActionListener(new java.awt.event.ActionListener() {
	        public void actionPerformed(java.awt.event.ActionEvent evt) {
	            jButton2ActionPerformed(evt);
	        }
	    });
	
	    javax.swing.GroupLayout gl_jPanel7 = new javax.swing.GroupLayout(jPanel7);
	    jPanel7.setLayout(gl_jPanel7);
	    gl_jPanel7.setHorizontalGroup(
	        gl_jPanel7.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
	        .addComponent(upButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	        .addComponent(downButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	    );
	    gl_jPanel7.setVerticalGroup(
	        gl_jPanel7.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
	        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, gl_jPanel7.createSequentialGroup()
	            .addContainerGap()
	            .addComponent(upButton, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 67, Short.MAX_VALUE)
	            .addComponent(downButton, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addContainerGap())
	    );
	
	    jPanel9.setBackground(new java.awt.Color(0, 0, 0));
	    jPanel9.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
	
	    statusLampElev1.setVerticalAlignment(JLabel.CENTER);
	    statusLampElev1.setHorizontalAlignment(JLabel.CENTER);
	    statusLampElev1.setBackground(new java.awt.Color(0, 0, 0));
	    statusLampElev1.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    statusLampElev1.setForeground(new java.awt.Color(255, 51, 0));
	
	    lampElev1_2.setAlignment(java.awt.Label.CENTER);
	    lampElev1_2.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lampElev1_2.setForeground(new java.awt.Color(255, 51, 0));
	    lampElev1_2.setText("2");
	
	    lampElev1_3.setAlignment(java.awt.Label.CENTER);
	    lampElev1_3.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lampElev1_3.setForeground(new java.awt.Color(255, 51, 0));
	    lampElev1_3.setText("3");
	
	    lampElev1_4.setAlignment(java.awt.Label.CENTER);
	    lampElev1_4.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lampElev1_4.setForeground(new java.awt.Color(255, 51, 0));
	    lampElev1_4.setText("4");
	
	    lampElev1_5.setAlignment(java.awt.Label.CENTER);
	    lampElev1_5.setFont(new java.awt.Font("Dialog", 1, 22));
	    lampElev1_5.setForeground(new java.awt.Color(255, 51, 0));
	    lampElev1_5.setText("5");
	
	    javax.swing.GroupLayout gl_jPanel9 = new javax.swing.GroupLayout(jPanel9);
	    gl_jPanel9.setHorizontalGroup(
	    	gl_jPanel9.createParallelGroup(Alignment.LEADING)
	    		.addGroup(gl_jPanel9.createSequentialGroup()
	    			.addComponent(statusLampElev1, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
	    			.addGap(25)
	    			.addComponent(lampElev1_2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	    			.addPreferredGap(ComponentPlacement.RELATED)
	    			.addComponent(lampElev1_3, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	    			.addPreferredGap(ComponentPlacement.RELATED)
	    			.addComponent(lampElev1_4, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	    			.addPreferredGap(ComponentPlacement.RELATED)
	    			.addComponent(lampElev1_5, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	    			.addContainerGap())
	    );
	    gl_jPanel9.setVerticalGroup(
	    	gl_jPanel9.createParallelGroup(Alignment.LEADING)
	    		.addGroup(gl_jPanel9.createParallelGroup(Alignment.CENTER, false)
	    			.addComponent(lampElev1_5, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
	    			.addComponent(lampElev1_4, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
	    			.addComponent(lampElev1_3, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
	    			.addComponent(lampElev1_2, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
	    			.addComponent(statusLampElev1, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE))
	    );
	    jPanel9.setLayout(gl_jPanel9);
	
	    jPanel12.setBackground(new java.awt.Color(0, 0, 0));
	    jPanel12.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
	
	    lampTElev1.setAlignment(java.awt.Label.CENTER);
	    lampTElev1.setBackground(new java.awt.Color(0, 0, 0));
	    lampTElev1.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lampTElev1.setForeground(new java.awt.Color(255, 51, 0));
	    lampTElev1.setText("T");
	
	    lamp1Elev1.setAlignment(java.awt.Label.CENTER);
	    lamp1Elev1.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lamp1Elev1.setForeground(new java.awt.Color(255, 51, 0));
	    lamp1Elev1.setText("1");
	
	    lamp2Elev1.setAlignment(java.awt.Label.CENTER);
	    lamp2Elev1.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lamp2Elev1.setForeground(new java.awt.Color(255, 51, 0));
	    lamp2Elev1.setText("2");
	
	    lamp3Elev1.setAlignment(java.awt.Label.CENTER);
	    lamp3Elev1.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lamp3Elev1.setForeground(new java.awt.Color(255, 51, 0));
	    lamp3Elev1.setText("3");
	
	    lamp4Elev1.setAlignment(java.awt.Label.CENTER);
	    lamp4Elev1.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lamp4Elev1.setForeground(new java.awt.Color(255, 51, 0));
	    lamp4Elev1.setText("4");
	
	    lamp5Elev1.setAlignment(java.awt.Label.CENTER);
	    lamp5Elev1.setFont(new java.awt.Font("Dialog", 1, 22));
	    lamp5Elev1.setForeground(new java.awt.Color(255, 51, 0));
	    lamp5Elev1.setText("5");
	
	    javax.swing.GroupLayout gl_jPanel12 = new javax.swing.GroupLayout(jPanel12);
	    jPanel12.setLayout(gl_jPanel12);
	    gl_jPanel12.setHorizontalGroup(
	        gl_jPanel12.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
	        .addGroup(gl_jPanel12.createSequentialGroup()
	            .addContainerGap()
	            .addComponent(lampTElev1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addGap(23, 23, 23)
	            .addComponent(lamp1Elev1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addGap(23, 23, 23)
	            .addComponent(lamp2Elev1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addGap(26, 26, 26)
	            .addComponent(lamp3Elev1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addGap(26, 26, 26)
	            .addComponent(lamp4Elev1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addGap(26, 26, 26)
	            .addComponent(lamp5Elev1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addContainerGap())
	    );
	    gl_jPanel12.setVerticalGroup(
	        gl_jPanel12.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
	        .addGroup(gl_jPanel12.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER, false)
	            .addComponent(lamp5Elev1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addComponent(lampTElev1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addComponent(lamp1Elev1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addComponent(lamp4Elev1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addComponent(lamp3Elev1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addComponent(lamp2Elev1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
	    );
	
	    jPanel11.setBackground(new java.awt.Color(0, 0, 0));
	    jPanel11.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
	
	    statusLampElev2.setVerticalAlignment(JLabel.CENTER);
	    statusLampElev2.setHorizontalAlignment(JLabel.CENTER);
	    statusLampElev2.setBackground(new java.awt.Color(0, 0, 0));
	    statusLampElev2.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    statusLampElev2.setForeground(new java.awt.Color(255, 51, 0));
	
	    lampElev1_11.setAlignment(java.awt.Label.CENTER);
	    lampElev1_11.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lampElev1_11.setForeground(new java.awt.Color(255, 51, 0));
	    lampElev1_11.setText("2");
	
	    lampElev1_12.setAlignment(java.awt.Label.CENTER);
	    lampElev1_12.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lampElev1_12.setForeground(new java.awt.Color(255, 51, 0));
	    lampElev1_12.setText("3");
	
	    lampElev1_13.setAlignment(java.awt.Label.CENTER);
	    lampElev1_13.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lampElev1_13.setForeground(new java.awt.Color(255, 51, 0));
	    lampElev1_13.setText("4");
	
	    lampElev1_14.setAlignment(java.awt.Label.CENTER);
	    lampElev1_14.setFont(new java.awt.Font("Dialog", 1, 22));
	    lampElev1_14.setForeground(new java.awt.Color(255, 51, 0));
	    lampElev1_14.setText("5");
	
	    javax.swing.GroupLayout gl_jPanel11 = new javax.swing.GroupLayout(jPanel11);
	    gl_jPanel11.setHorizontalGroup(
	    	gl_jPanel11.createParallelGroup(Alignment.LEADING)
	    		.addGroup(gl_jPanel11.createSequentialGroup()
	    			.addComponent(statusLampElev2, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)
	    			.addGap(36)
	    			.addComponent(lampElev1_11, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	    			.addPreferredGap(ComponentPlacement.RELATED)
	    			.addComponent(lampElev1_12, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	    			.addPreferredGap(ComponentPlacement.RELATED)
	    			.addComponent(lampElev1_13, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	    			.addPreferredGap(ComponentPlacement.RELATED)
	    			.addComponent(lampElev1_14, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	    			.addContainerGap())
	    );
	    gl_jPanel11.setVerticalGroup(
	    	gl_jPanel11.createParallelGroup(Alignment.LEADING)
	    		.addGroup(gl_jPanel11.createParallelGroup(Alignment.CENTER, false)
	    			.addComponent(lampElev1_14, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
	    			.addComponent(lampElev1_13, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
	    			.addComponent(lampElev1_12, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
	    			.addComponent(lampElev1_11, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
	    			.addComponent(statusLampElev2, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE))
	    );
	    jPanel11.setLayout(gl_jPanel11);
	
	    jPanel13.setBackground(new java.awt.Color(0, 0, 0));
	    jPanel13.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
	
	    lampTElev2.setAlignment(java.awt.Label.CENTER);
	    lampTElev2.setBackground(new java.awt.Color(0, 0, 0));
	    lampTElev2.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lampTElev2.setForeground(new java.awt.Color(255, 51, 0));
	    lampTElev2.setText("T");
	
	    lamp1Elev2.setAlignment(java.awt.Label.CENTER);
	    lamp1Elev2.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lamp1Elev2.setForeground(new java.awt.Color(255, 51, 0));
	    lamp1Elev2.setText("1");
	
	    lamp2Elev2.setAlignment(java.awt.Label.CENTER);
	    lamp2Elev2.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lamp2Elev2.setForeground(new java.awt.Color(255, 51, 0));
	    lamp2Elev2.setText("2");
	
	    lamp3Elev2.setAlignment(java.awt.Label.CENTER);
	    lamp3Elev2.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lamp3Elev2.setForeground(new java.awt.Color(255, 51, 0));
	    lamp3Elev2.setText("3");
	
	    lamp4Elev2.setAlignment(java.awt.Label.CENTER);
	    lamp4Elev2.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
	    lamp4Elev2.setForeground(new java.awt.Color(255, 51, 0));
	    lamp4Elev2.setText("4");
	
	    lamp5Elev2.setAlignment(java.awt.Label.CENTER);
	    lamp5Elev2.setFont(new java.awt.Font("Dialog", 1, 22));
	    lamp5Elev2.setForeground(new java.awt.Color(255, 51, 0));
	    lamp5Elev2.setText("5");
	
	    javax.swing.GroupLayout gl_jPanel13 = new javax.swing.GroupLayout(jPanel13);
	    jPanel13.setLayout(gl_jPanel13);
	    gl_jPanel13.setHorizontalGroup(
	        gl_jPanel13.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
	        .addGroup(gl_jPanel13.createSequentialGroup()
	            .addContainerGap()
	            .addComponent(lampTElev2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addGap(23, 23, 23)
	            .addComponent(lamp1Elev2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addGap(23, 23, 23)
	            .addComponent(lamp2Elev2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addGap(26, 26, 26)
	            .addComponent(lamp3Elev2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addGap(26, 26, 26)
	            .addComponent(lamp4Elev2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addGap(26, 26, 26)
	            .addComponent(lamp5Elev2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	            .addContainerGap())
	    );
	    gl_jPanel13.setVerticalGroup(
	        gl_jPanel13.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
	        .addGroup(gl_jPanel13.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER, false)
	            .addComponent(lamp5Elev2, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addComponent(lampTElev2, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addComponent(lamp1Elev2, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addComponent(lamp4Elev2, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addComponent(lamp3Elev2, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
	            .addComponent(lamp2Elev2, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
	    );
	
	    jPanel14.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null, null, java.awt.Color.darkGray, java.awt.Color.lightGray));
	
	    jSeparator9.setForeground(new java.awt.Color(51, 51, 51));
	    jSeparator9.setOrientation(javax.swing.SwingConstants.VERTICAL);
	
	    javax.swing.GroupLayout gl_jPanel14 = new javax.swing.GroupLayout(jPanel14);
	    gl_jPanel14.setHorizontalGroup(
	    	gl_jPanel14.createParallelGroup(Alignment.TRAILING)
	    		.addGroup(gl_jPanel14.createSequentialGroup()
	    			.addContainerGap(185, Short.MAX_VALUE)
	    			.addComponent(jSeparator9, GroupLayout.PREFERRED_SIZE, 187, GroupLayout.PREFERRED_SIZE))
	    );
	    gl_jPanel14.setVerticalGroup(
	    	gl_jPanel14.createParallelGroup(Alignment.LEADING)
	    		.addComponent(jSeparator9, GroupLayout.DEFAULT_SIZE, 339, Short.MAX_VALUE)
	    );
	    jPanel14.setLayout(gl_jPanel14);
	
	    jPanel15.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null, null, java.awt.Color.darkGray, java.awt.Color.lightGray));
	
	    jSeparator10.setForeground(new java.awt.Color(51, 51, 51));
	    jSeparator10.setOrientation(javax.swing.SwingConstants.VERTICAL);
	
	    javax.swing.GroupLayout gl_jPanel15 = new javax.swing.GroupLayout(jPanel15);
	    gl_jPanel15.setHorizontalGroup(
	    	gl_jPanel15.createParallelGroup(Alignment.TRAILING)
	    		.addGroup(gl_jPanel15.createSequentialGroup()
	    			.addContainerGap(185, Short.MAX_VALUE)
	    			.addComponent(jSeparator10, GroupLayout.PREFERRED_SIZE, 187, GroupLayout.PREFERRED_SIZE))
	    );
	    gl_jPanel15.setVerticalGroup(
	    	gl_jPanel15.createParallelGroup(Alignment.LEADING)
	    		.addComponent(jSeparator10, GroupLayout.DEFAULT_SIZE, 339, Short.MAX_VALUE)
	    );
	    jPanel15.setLayout(gl_jPanel15);
	    
	    panelSelDestE1 = new JPanel();
	    
	    btnTE1 = new JButton();
	    btnTE1.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator1 != null) {
	    			elevator1.resetSensor();
	    		}
	    		if (btnTE1.getForeground() == Color.BLACK) {
	    			destinysE1.add(0);
	    			btnTE1.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btnTE1.setText("T");
	    btnTE1.setFont(new Font("Tahoma", Font.BOLD, 36));
	    
	    btn1E1 = new JButton();
	    btn1E1.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator1 != null) {
	    			elevator1.resetSensor();
	    		}
	    		if (btn1E1.getForeground() == Color.BLACK) {
	    			destinysE1.add(1);
	    			btn1E1.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btn1E1.setText("1");
	    btn1E1.setFont(new Font("Tahoma", Font.BOLD, 36));
	    
	    btn2E1 = new JButton();
	    btn2E1.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator1 != null) {
	    			elevator1.resetSensor();
	    		}
	    		if (btn2E1.getForeground() == Color.BLACK) {
	    			destinysE1.add(2);
	    			btn2E1.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btn2E1.setText("2");
	    btn2E1.setFont(new Font("Tahoma", Font.BOLD, 36));
	    
	    btn3E1 = new JButton();
	    btn3E1.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator1 != null) {
	    			elevator1.resetSensor();
	    		}
	    		if (btn3E1.getForeground() == Color.BLACK) {
	    			destinysE1.add(3);
	    			btn3E1.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btn3E1.setText("3");
	    btn3E1.setFont(new Font("Tahoma", Font.BOLD, 36));
	    
	    btn4E1 = new JButton();
	    btn4E1.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator1 != null) {
	    			elevator1.resetSensor();
	    		}
	    		if (btn4E1.getForeground() == Color.BLACK) {
	    			destinysE1.add(4);
	    			btn4E1.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btn4E1.setText("4");
	    btn4E1.setFont(new Font("Tahoma", Font.BOLD, 36));
	    
	    btn5E1 = new JButton();
	    btn5E1.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator1 != null) {
	    			elevator1.resetSensor();
	    		}
	    		if (btn5E1.getForeground() == Color.BLACK) {
	    			destinysE1.add(5);
	    			btn5E1.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btn5E1.setText("5");
	    btn5E1.setFont(new Font("Tahoma", Font.BOLD, 36));
	    GroupLayout gl_panelSelDestE1 = new GroupLayout(panelSelDestE1);
	    gl_panelSelDestE1.setHorizontalGroup(
	    	gl_panelSelDestE1.createParallelGroup(Alignment.LEADING)
	    		.addGroup(gl_panelSelDestE1.createSequentialGroup()
	    			.addContainerGap()
	    			.addGroup(gl_panelSelDestE1.createParallelGroup(Alignment.TRAILING)
	    				.addGroup(gl_panelSelDestE1.createSequentialGroup()
	    					.addComponent(btnTE1, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)
	    					.addPreferredGap(ComponentPlacement.RELATED, 76, Short.MAX_VALUE)
	    					.addComponent(btn1E1, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))
	    				.addGroup(gl_panelSelDestE1.createSequentialGroup()
	    					.addComponent(btn3E1, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)
	    					.addPreferredGap(ComponentPlacement.RELATED, 76, Short.MAX_VALUE)
	    					.addComponent(btn4E1, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)))
	    			.addGap(67)
	    			.addGroup(gl_panelSelDestE1.createParallelGroup(Alignment.LEADING)
	    				.addComponent(btn5E1, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(btn2E1, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))
	    			.addContainerGap())
	    );
	    gl_panelSelDestE1.setVerticalGroup(
	    	gl_panelSelDestE1.createParallelGroup(Alignment.LEADING)
	    		.addGroup(gl_panelSelDestE1.createSequentialGroup()
	    			.addContainerGap()
	    			.addGroup(gl_panelSelDestE1.createParallelGroup(Alignment.BASELINE)
	    				.addComponent(btn2E1, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(btn1E1, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(btnTE1, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE))
	    			.addGap(18)
	    			.addGroup(gl_panelSelDestE1.createParallelGroup(Alignment.BASELINE)
	    				.addComponent(btn3E1, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(btn5E1, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(btn4E1, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE))
	    			.addContainerGap(31, Short.MAX_VALUE))
	    );
	    panelSelDestE1.setLayout(gl_panelSelDestE1);
	    
	    panelSelDestE2 = new JPanel();
	    
	    btnTE2 = new JButton();
	    btnTE2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				if (elevator2 != null) {
	    			elevator2.resetSensor();
	    		}
	    		if (btnTE2.getForeground() == Color.BLACK) {
	    			destinysE2.add(0);
	    			btnTE2.setForeground(new Color(0, 200, 0));
	    		}
			}
	    });
	    btnTE2.setText("T");
	    btnTE2.setFont(new Font("Tahoma", Font.BOLD, 36));
	    
	    btn1E2 = new JButton();
	    btn1E2.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator2 != null) {
	    			elevator2.resetSensor();
	    		}
	    		if (btn1E2.getForeground() == Color.BLACK) {
	    			destinysE2.add(1);
	    			btn1E2.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btn1E2.setText("1");
	    btn1E2.setFont(new Font("Tahoma", Font.BOLD, 36));
	    
	    btn2E2 = new JButton();
	    btn2E2.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator2 != null) {
	    			elevator2.resetSensor();
	    		}
	    		if (btn2E2.getForeground() == Color.BLACK) {
	    			destinysE2.add(2);
	    			btn2E2.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btn2E2.setText("2");
	    btn2E2.setFont(new Font("Tahoma", Font.BOLD, 36));
	    
	    btn3E2 = new JButton();
	    btn3E2.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator2 != null) {
	    			elevator2.resetSensor();
	    		}
	    		if (btn3E2.getForeground() == Color.BLACK) {
	    			destinysE2.add(3);
	    			btn3E2.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btn3E2.setText("3");
	    btn3E2.setFont(new Font("Tahoma", Font.BOLD, 36));
	    
	    btn4E2 = new JButton();
	    btn4E2.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator2 != null) {
	    			elevator2.resetSensor();
	    		}
	    		if (btn4E2.getForeground() == Color.BLACK) {
	    			destinysE2.add(4);
	    			btn4E2.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btn4E2.setText("4");
	    btn4E2.setFont(new Font("Tahoma", Font.BOLD, 36));
	    
	    btn5E2 = new JButton();
	    btn5E2.addActionListener(new ActionListener() {
	    	public void actionPerformed(ActionEvent e) {
	    		if (elevator2 != null) {
	    			elevator2.resetSensor();
	    		}
	    		if (btn5E2.getForeground() == Color.BLACK) {
	    			destinysE2.add(5);
	    			btn5E2.setForeground(new Color(0, 200, 0));
	    		}
	    	}
	    });
	    btn5E2.setText("5");
	    btn5E2.setFont(new Font("Tahoma", Font.BOLD, 36));
	    GroupLayout gl_panelSelDestE2 = new GroupLayout(panelSelDestE2);
	    gl_panelSelDestE2.setHorizontalGroup(
	    	gl_panelSelDestE2.createParallelGroup(Alignment.LEADING)
	    		.addGap(0, 355, Short.MAX_VALUE)
	    		.addGroup(gl_panelSelDestE2.createSequentialGroup()
	    			.addContainerGap()
	    			.addGroup(gl_panelSelDestE2.createParallelGroup(Alignment.TRAILING)
	    				.addGroup(gl_panelSelDestE2.createSequentialGroup()
	    					.addComponent(btnTE2, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)
	    					.addPreferredGap(ComponentPlacement.RELATED, 76, Short.MAX_VALUE)
	    					.addComponent(btn1E2, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))
	    				.addGroup(gl_panelSelDestE2.createSequentialGroup()
	    					.addComponent(btn3E2, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)
	    					.addPreferredGap(ComponentPlacement.RELATED, 76, Short.MAX_VALUE)
	    					.addComponent(btn4E2, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)))
	    			.addGap(67)
	    			.addGroup(gl_panelSelDestE2.createParallelGroup(Alignment.LEADING)
	    				.addComponent(btn5E2, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(btn2E2, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))
	    			.addContainerGap())
	    );
	    gl_panelSelDestE2.setVerticalGroup(
	    	gl_panelSelDestE2.createParallelGroup(Alignment.LEADING)
	    		.addGap(0, 165, Short.MAX_VALUE)
	    		.addGroup(gl_panelSelDestE2.createSequentialGroup()
	    			.addContainerGap()
	    			.addGroup(gl_panelSelDestE2.createParallelGroup(Alignment.BASELINE)
	    				.addComponent(btn2E2, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(btn1E2, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(btnTE2, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE))
	    			.addGap(18)
	    			.addGroup(gl_panelSelDestE2.createParallelGroup(Alignment.BASELINE)
	    				.addComponent(btn3E2, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(btn5E2, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(btn4E2, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE))
	    			.addContainerGap(31, Short.MAX_VALUE))
	    );
	    panelSelDestE2.setLayout(gl_panelSelDestE2);
	
	    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
	    layout.setHorizontalGroup(
	    	layout.createParallelGroup(Alignment.LEADING)
	    		.addGroup(layout.createSequentialGroup()
	    			.addGroup(layout.createParallelGroup(Alignment.LEADING)
	    				.addGroup(layout.createSequentialGroup()
	    					.addGap(10)
	    					.addComponent(label1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
	    				.addGroup(layout.createSequentialGroup()
	    					.addContainerGap()
	    					.addGroup(layout.createParallelGroup(Alignment.LEADING)
	    						.addGroup(layout.createSequentialGroup()
	    							.addComponent(jPanel9, GroupLayout.PREFERRED_SIZE, 47, GroupLayout.PREFERRED_SIZE)
	    							.addPreferredGap(ComponentPlacement.RELATED)
	    							.addComponent(jPanel12, GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE))
	    						.addComponent(jPanel15, GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE))
	    					.addPreferredGap(ComponentPlacement.RELATED)
	    					.addComponent(jPanel7, GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE)
	    					.addPreferredGap(ComponentPlacement.RELATED)
	    					.addGroup(layout.createParallelGroup(Alignment.LEADING)
	    						.addGroup(layout.createSequentialGroup()
	    							.addComponent(jPanel11, GroupLayout.PREFERRED_SIZE, 47, GroupLayout.PREFERRED_SIZE)
	    							.addPreferredGap(ComponentPlacement.RELATED)
	    							.addComponent(jPanel13, GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE))
	    						.addComponent(jPanel14, GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE))))
	    			.addContainerGap())
	    		.addComponent(jSeparator1, GroupLayout.PREFERRED_SIZE, 892, Short.MAX_VALUE)
	    		.addGroup(layout.createSequentialGroup()
	    			.addGap(20)
	    			.addComponent(panelSelDestE1, GroupLayout.PREFERRED_SIZE, 355, GroupLayout.PREFERRED_SIZE)
	    			.addPreferredGap(ComponentPlacement.RELATED, 142, Short.MAX_VALUE)
	    			.addComponent(panelSelDestE2, GroupLayout.PREFERRED_SIZE, 355, GroupLayout.PREFERRED_SIZE)
	    			.addGap(20))
	    );
	    layout.setVerticalGroup(
	    	layout.createParallelGroup(Alignment.LEADING)
	    		.addGroup(layout.createSequentialGroup()
	    			.addContainerGap()
	    			.addComponent(label1, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
	    			.addPreferredGap(ComponentPlacement.RELATED)
	    			.addComponent(jSeparator1, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)
	    			.addPreferredGap(ComponentPlacement.RELATED)
	    			.addGroup(layout.createParallelGroup(Alignment.LEADING)
	    				.addComponent(jPanel7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
	    				.addGroup(layout.createSequentialGroup()
	    					.addGroup(layout.createParallelGroup(Alignment.LEADING)
	    						.addComponent(jPanel11, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
	    						.addComponent(jPanel13, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
	    					.addPreferredGap(ComponentPlacement.UNRELATED)
	    					.addComponent(jPanel14, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
	    				.addGroup(layout.createSequentialGroup()
	    					.addGroup(layout.createParallelGroup(Alignment.LEADING)
	    						.addComponent(jPanel9, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
	    						.addComponent(jPanel12, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
	    					.addPreferredGap(ComponentPlacement.UNRELATED)
	    					.addComponent(jPanel15, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
	    			.addGap(18)
	    			.addGroup(layout.createParallelGroup(Alignment.LEADING)
	    				.addComponent(panelSelDestE1, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
	    				.addComponent(panelSelDestE2, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE))
	    			.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
	    );
	    this.setLayout(layout);
	}// </editor-fold>//GEN-END:initComponents

	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
	        upButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/buttonSetUp.png")));
	        downButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/buttonDown.png")));
	        Scheduler.getInstance().requestElevator(Direction.UP, floorNumber);
	        if (panelSelDestE1.isVisible() || panelSelDestE2.isVisible()) {
	        	upButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/buttonUp.png")));
	        	if (elevator1 != null) {
	        		elevator1.resetSensor();
	        	} else if (elevator2 != null) {
	        		elevator2.resetSensor();
	        	}
	        }
	}//GEN-LAST:event_jButton1ActionPerformed

	private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
	        downButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/buttonSetDown.png")));
	        upButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/buttonUp.png")));
	        Scheduler.getInstance().requestElevator(Direction.DOWN, floorNumber);
	        if (panelSelDestE1.isVisible() || panelSelDestE2.isVisible()) {
	        	downButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/buttonDown.png")));
	        	if (elevator1 != null) {
	        		elevator1.resetSensor();
	        	} else if (elevator2 != null) {
	        		elevator2.resetSensor();
	        	}
	        }
	}//GEN-LAST:event_jButton2ActionPerformed

	public JButton getBtnDestinyElevator(int floor, int elevator) {
    	if (elevator == 1) {
    		return btnsDestE1.get(floor);
    	} else {
    		return btnsDestE2.get(floor);
    	}
    }

    public Label getLamp(int floor, int elevator) {
		if (elevator == 1) {
			return lampListElev1.get(floor);
		} else {
			return lampListElev2.get(floor);
		}
    }

    public JLabel getStatusLamp(int elevator) {
		if (elevator == 1) {
			return statusLampElev1;
		} else {
			return statusLampElev2;
		}
    }

    public JPanel getSelDestinyPanel(int elevator) {
    	if (elevator == 1) {
    		return this.panelSelDestE1;
    	} else {
    		return this.panelSelDestE2;
    	}
    }

    public void setElevator(Elevator elevator, int number) {
		if (number == 1) {
			this.elevator1 = elevator;
		} else {
			this.elevator2 = elevator;
		}
	}

	public ArrayList<Integer> getDestinys(int elevator) {
		if (elevator == 1) {
			return destinysE1;
		} else {
			return destinysE2;
		}
	}

	public JButton getUpButton() {
		return this.upButton;
	}

	public JButton getDownButton() {
		return this.downButton;
	}

}
